<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0">
  <xsl:output method="html" />
  <xsl:template match="/">
    <html>
    <head>
    <title><xsl:value-of select="/rss/channel/title"/></title>
	<style>
		#subItem a:link,#subItem a:visited {
		text-decoration: none;
		color: #666666;
		}
		#subItem a:hover, #subItem a:active{
			text-decoration: none;
			color: #999999;
		}
	</style>
    </head>
    <body>
    <xsl:attribute name="style">font-family: 'Tahoma'; font-size: 10pt;margin-right: 300px;</xsl:attribute>
    <xsl:apply-templates/>
    </body>
    <script>
	<![CDATA[
		function sr(s,f,r)
		{
		  var ret = s;
		  var start = ret.indexOf(f);
		  while (start>=0)
		  {
			ret = ret.substring(0,start) + r + ret.substring(start+f.length,ret.length);
			start = ret.indexOf(f,start+r.length);
		  }
		  return ret;
		} 
		
		function moz()
		{
		  var i, o, d, t;
		  for( i = 1; i; i++)
		  {
			d = "d_" + i;
			o = document.getElementById(d);
			if( o == null ) break;
			if( null != o.innerText ) break; // IE ok
			t = unescape( o.innerHTML );
			t = sr( t, "&gt;", ">" );
			t = sr( t, "&lt;", "<" );
			t = sr( t, "&amp;", "&" );
			o.innerHTML = t;
		  }
		}
		moz();
		
		]]>
  </script>
    </html>
  </xsl:template>
  <xsl:template match="/rss/channel">
    <a>
    <xsl:attribute name="name">top</xsl:attribute>
    </a>
    <p>
      <xsl:if test="image">
        <a>
        <xsl:attribute name="href"><xsl:value-of select="image/link"/></xsl:attribute>
        <img>
        <xsl:attribute name="border">0</xsl:attribute>
        <xsl:attribute name="src"><xsl:value-of select="image/url"/></xsl:attribute>
        <xsl:attribute name="alt"><xsl:value-of select="image/description"/></xsl:attribute>
        <xsl:attribute name="title"><xsl:value-of select="image/title"/></xsl:attribute>
        <xsl:attribute name="align">right</xsl:attribute>
        </img></a><br />
      </xsl:if>
      <b>
      <xsl:attribute name="style">color: #4286EF;font-size: 20px;</xsl:attribute>
      <xsl:value-of select="title"/></b><br />
      <xsl:choose>
        <xsl:when test="count(item) = 1">
There is only one post shown in this feed.
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="count(item)"/>posts are shown in this feed.
        </xsl:otherwise>
      </xsl:choose>
    </p>
    <table>
      <xsl:attribute name="border">0</xsl:attribute>
      <xsl:attribute name="cellpadding">10</xsl:attribute>
      <xsl:attribute name="cellspacing">10</xsl:attribute>
      <xsl:attribute name="style">font-size: 10pt;</xsl:attribute>
      <xsl:for-each select="item">
        <tr>
          <xsl:choose>
            <xsl:when test="position() mod 2 = 0">
              <xsl:attribute name="style">margin: 10 10 10 10;</xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
              <xsl:attribute name="style">margin: 10 10 10 10;</xsl:attribute>
            </xsl:otherwise>
          </xsl:choose>
          <td><xsl:attribute name='style'></xsl:attribute>
            <table>
              <xsl:attribute name="style">font-size: 8pt;</xsl:attribute>
              <xsl:attribute name="border">0</xsl:attribute>
              <xsl:attribute name="cellspacing">0</xsl:attribute>
              <xsl:attribute name="cellpadding">0</xsl:attribute>
              <xsl:attribute name="width">100%</xsl:attribute>
              <tr>
                <td><div id="subItem">
					<a>
					<xsl:attribute name="style">font-size: 14px;</xsl:attribute>
                  	<xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
                  	<b><xsl:value-of select="title"/></b>
					</a>
					</div>
				  	<hr style=" height:1px; color:#CCCCCC" />
				</td>
              </tr>
              <tr>
                <td>
				<xsl:attribute name="style">color:#999999</xsl:attribute>
				<xsl:value-of select="position()"/>of<xsl:value-of select="count(/rss/channel/item)"/>(Published:<xsl:value-of select="pubDate"/>)</td>
              </tr>
            </table>
            <br />
            <div>
              <xsl:attribute name="id">d_<xsl:value-of select="position()"/></xsl:attribute>
              <xsl:value-of disable-output-escaping="yes" select="description"/></div>
            <br /></td>
        </tr>
      </xsl:for-each>
    </table>
    <p>copyRight:http://www.newpub.cn</p>
  </xsl:template>
</xsl:stylesheet>
